a=load('time.dat');
b=load('memory.dat');
tick=[1,2,4,8,12];

figure(1);
plot(tick,a(:,1),'b-p');
hold on
plot(tick,a(:,2),'r-^');
plot(tick,a(:,3),'g-h');
xlabel('Number of cubes');
ylabel('Time(s)');
legend('MoM','EPA','MLFMA');
title('Time consumed');

figure(2);
plot(tick,b(:,1),'b-p');
hold on
plot(tick,b(:,2),'r-^');
plot(tick,b(:,3),'g-h');
xlabel('Number of cubes');
ylabel('Memory(MByte)');
legend('MoM','EPA','MLFMA');
title('Maximum memory usage');